from wsgiref import simple_server

import falcon
from app.test import test as TestResource



class ThingsResource(object):
    def on_get(self, req, resp):
        """Handles GET requests"""
        resp.status = falcon.HTTP_200
        resp.body = ('Hello World')


app = application = falcon.API()
things = ThingsResource()
test = TestResource.TestImgResource()
app.add_route('/test', things)
app.add_route('/test/images', test)


'''serve init'''
if __name__ == '__main__':
    from waitress import serve

    serve(app, listen="*:8080")

    # httpd = simple_server.make_server('127.0.0.1', 8000, app)
    # httpd.serve_forever()
